#ifndef CELLDATAFORMAT_H
#define CELLDATAFORMAT_H

#include <QHBoxLayout>
#include <QLabel>
#include <QStandardItemModel>
#include <QTableView>
#include "AGV_Data_Storage.h"

enum class CellType
{
    STRING_DATA,
    ICON,
    OTHER,
    TABLE_ID
};

struct VehicleDataType{
    QMap<QString,QMap<int,QString>> Vehicle_Profile = {
        {"AGV品牌",{{0, "自研"},{1, "睿芯行"}}},
        {"AGV类型",{{1, "顶升车"},{2, "搬运车"},{3, "堆高车"}}},
        {"电池类型",{{0, "磷酸铁锂"}}}
    };

    QMap<QString,QMap<int,QString>> Vehicle_Status = {
        {"充电状态",{{0, "空闲"},{1, "充电中"}}},
        {"AGV类型",{{1, "顶升车"},{2, "搬运车"},{3, "堆高车"}}},
        {"路径到达状态",{{0, "空闲"},{1, "成功"},{2, "失败"},{3, "执行中"}}},
        {"动作完成状态",{{0, "空闲"},{1, "成功"},{2, "失败"},{3, "执行中"}}},
        {"执行路径状态",{{0, "空闲"},{1, "繁忙"}}},
        {"运行状态",{{0, "正常"},{1, "暂停"}}}
    };

    QMap<QString,QMap<int,QString>> Map_Config = {
        {"地图状态",{{0, "禁用"},{1, "启用中"},{2, "维护中"}}},
        {"地图类型",{{1, "2D平面图"},{2, "3D立体图"},{3, "混合图"}}}
    };

    QMap<QString,QMap<int,QString>> District_Seats = {
        {"区域类型",{{0, "默认区域"},{1, "等待区"},{2, "充电区"},{3, "卸货区"}}},
    };

    QMap<QString,QMap<int,QString>> Nodes = {
        {"站点类型",{{0, "普通节点"},{1, "取货点"},{2, "卸货点"},{3, "充电点"},{4, "等待点"},{5, "停车点"}}},
        {"是否为重定位点",{{0, "否"},{1, "是"}}}
    };

    QMap<QString,QMap<int,QString>> Obstacle_Strategy = {
        {"避障相机开关",{{0, "关闭"},{1, "开启"}}},
        {"避障激光开关",{{0, "关闭"},{1, "开启"}}},
        {"后导航避障激光开关",{{0, "关闭"},{1, "开启"}}},
        {"导航避障激光开关",{{0, "关闭"},{1, "开启"}}},
        {"叉尖点激光开关",{{0, "关闭"},{1, "开启"}}},
        {"左叉尖避障激光开关",{{0, "关闭"},{1, "开启"}}},
        {"右叉尖避障激光开关",{{0, "关闭"},{1, "开启"}}},
        {"中部避障激光开关",{{0, "关闭"},{1, "开启"}}}
    };

    QMap<QString,QMap<int,QString>> Tasks = {
        {"任务类型",{{0, "搬运任务"},{1, "故障任务"},{2, "单动作任务"},{3, "去到某待命点任务"}}},
        {"任务执行状态",{{0, "未执行"},{1, "分配中"},{2, "执行中"},{3, "完成"},{4, "人工辅助完成"},{5, "已取消"},{6, "暂停中"},{7, "其他异常"}}}
    };

    QMap<QString,QMap<int,QString>> Action_Set = {
        {"动作类型",{{-1, "无动作"},{0, "搬运车举升或下降"},{1, "堆高车高度举升或下降"},{3, "顶升车上升或下降"},{4, "充电动作"},{5, "车辆旋转"},{6, "货物旋转"},
                 {7, "车辆旋转和货物旋转同时"},{8, "顶升车货架识别"},{9, "顶升车退出货架识别"},{16, "功能码"},{17, "货架名称"}}},
        {"动作",{{0, "下降"},{1, "上升"},{3, "二维码校验上升"},{4, "二维码校验下降"}}},
        {"是否边走边动作",{{0, "停车动作"},{1, "边走边动作"}}}
    };

};



class CellDataFormat
{
public:
    /**
     * @brief  构造函数
     */
    CellDataFormat();

    /**
     * @brief  界面显示数据库表时特殊字段转换成对应的显示数据
     * @param  tableView 指定显示控件的对象
     * @param  headerName 指定字段列
     * @param  index 指定行号
     * @return  返回界面需要显示的内容
     */
    QString setDataCell(QTableView *tableView,
                        const QString& headerName,
                        const int& index);

};

#endif // CELLDATAFORMAT_H
